var api = require('../../utils/api.js');
var app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        text:'',
        times:'',
        name:'',
        show:0,
        mobile:'',
        desc:'',
        leibie:'',
        array:['培训','大众点评好评','回收问卷','顾客口味收集反馈','新产品贡献','门店问题反馈（如可优化的/或存在的需要解决的问题/员工问题等）','门店任意流程优化','顾客活动意见']
    },
    onLoad(){
     },
onShow(){
    var that=this;
    api.post({
        url: 'index/show',
        data: {},
        success: data => {
            console.log(data);
            that.setData({
                show:data.data.show
            })
            
        }
    });
},
     getname(re){
        this.setData({
            name:re.detail.value
        })
     },
     getmobile(ret){
        this.setData({
            mobile:ret.detail.value
        })
     },
     getleix(ret){
        this.setData({
            leibie:ret.detail.value
        })
     },

     bindPickerChanges(ret){
        console.log(ret);

        var index=ret.detail.value;
        var list=this.data.array;
        var text=list[index];
        
        this.setData({
            text:text
        })
     },


     getdesc(ret){
        this.setData({
            desc:ret.detail.value
        })
     },
    submits(){
        var that=this;
        var name=this.data.name;
        var mobile=this.data.mobile;
        var text=this.data.text;
        var leibie=this.data.leibie;
        var desc=this.data.desc;

        api.post({
            url: 'yuyue/jiafen',
            data: {desc:desc,name:name,mobile:mobile,text:text,leibie:leibie},
            success: data => {
                console.log(data);
                
                wx.showToast({
                  title: data.msg,
                  icon:'none'
                })
            }
        });

    },
})